<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_goods', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('order_id')->comment('订单id');
            $table->integer('goods_id')->comment('商品id');
            $table->string('goods_name')->comment('商品名');
            $table->integer('goods_number')->default(1)->comment('商品数');
            $table->decimal('market_price',10,2)->default('0.00')->comment('市场价');
            $table->decimal('goods_price',10,2)->default('0.00')->comment('售价');
            $table->integer('sku_id')->comment('skuid');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_goods');
    }
}
